package com.cpi.cornpp.common.files.dto;

import java.util.Calendar;

/**
 * Corn Inventory Data Access Object
 * @author Edgar Joao
 * @see SAPComponentDTO
 */
public class SAPComponentCornInventoryDTO implements SAPComponentDTO{
	
	/**
	 * 
	 */
	private static final long serialVersionUID = 3545350075323189032L;
	private String plant;
	private String storageLocation;
	private String rawMaterial;
	private Calendar date;
	private double inventory;
	/*
	 * (non-Javadoc)
	 * @see java.lang.Object#equals(java.lang.Object)
	 */
	public boolean equals(Object object) {
		boolean equal = false;
		SAPComponentCornInventoryDTO sapComponentCornInventoryDTO = null;
		if( this == object ){
			equal = true;
		}else{
			if( this instanceof SAPComponentCornInventoryDTO ){
				sapComponentCornInventoryDTO = (SAPComponentCornInventoryDTO)object;
				if( this.hashCode() == sapComponentCornInventoryDTO.hashCode() ){
					equal = true;
				}
			}
		}
		return equal;
	}
	/*
	 * (non-Javadoc)
	 * @see java.lang.Object#hashCode()
	 */
	public int hashCode() {
		int hash = 0;
		hash =  ( this.plant != null ? this.plant.hashCode() : 0 );
		hash += ( this.storageLocation != null ? this.storageLocation.hashCode() : 0 );
		hash += ( this.rawMaterial != null ? this.rawMaterial.hashCode() : 0 );
		hash += (this.date != null? this.date.hashCode() : 0);
		hash += new Double(this.inventory).hashCode();
		return hash;
	}
	/*
	 * (non-Javadoc)
	 * @see java.lang.Object#toString()
	 */
	public String toString() {		
		StringBuffer toStringValue = null;
		toStringValue = new StringBuffer(0);
		toStringValue.append(getClass().getName());
		toStringValue.append(STRING_COLON);
		toStringValue.append(this.plant);
		toStringValue.append(STRING_COMMA);
		toStringValue.append(this.storageLocation);
		toStringValue.append(STRING_COMMA);
		toStringValue.append(this.rawMaterial);
		toStringValue.append(STRING_COMMA);
		toStringValue.append(this.date);
		toStringValue.append(STRING_COMMA);
		toStringValue.append(this.inventory);		
		toStringValue.append(STRING_COLON);
		return toStringValue.toString();
	}

	public String getPlant() {
		return plant;
	}

	public void setPlant(String argPlant) {
		plant = argPlant;
	}

	public String getStorageLocation() {
		return storageLocation;
	}

	public void setStorageLocation(String argStorageLocation) {
		storageLocation = argStorageLocation;
	}

	public String getRawMaterial() {
		return rawMaterial;
	}

	public void setRawMaterial(String argRawMaterial) {
		rawMaterial = argRawMaterial;
	}

	public Calendar getDate() {
		return date;
	}

	public void setDate(Calendar argDate) {
		date = argDate;
	}

	public double getInventory() {
		return inventory;
	}

	public void setInventory(double argInventory) {
		inventory = argInventory;
	}	
	
}
